// BBSDlg.h : header file
//

#pragma once
#include "afxcmn.h"
#include "afxwin.h"
#include "XListBox.h"
#include "TianyaParse.h"

#define WM_THREAD_EXIT	WM_USER + 33

DWORD WINAPI DownloadThread(LPVOID param);


// CBBSDlg dialog
class CBBSDlg : public CDialog
{
// Construction
public:
	CBBSDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_BBS_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

public:
	void AddLog(LPCTSTR str);
	void SetStatus(LPCTSTR str);
	void EnableControl(BOOL bEnable);

// Implementation
protected:
	HICON m_hIcon;

	int GetTaskFromTaskList();

	BOOL InitHtmlEvn();
	void DestroyHtmlEvn();

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg HRESULT OnThreadExit(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedOk();
	CString m_szSourceURL;
	CXListBox m_logList;
	HANDLE m_thread;
	BBS_PARAM *m_bbs;
	CProgressCtrl m_progress;
	afx_msg void OnBnClickedBtnOption();
	CXListBox m_ctlTaskList;
	afx_msg void OnBnClickedBtnAddjob();
	CStringArray m_taskList;
	afx_msg void OnBnClickedBtnPathopen();

public:
	IClassFactory *m_pICF;
public:
	afx_msg void OnDestroy();
public:
	afx_msg void OnBnClickedBtnCleantask();
};
